home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / WCLASS95.ZIP / SQLREAD.TXT < prev    next >
Encoding:
Text File  |  1995-09-15  |  2.3 KB  |  53 lines

  1.  
  2. SQL Code Generation Script to generate ANSI SQL tables
  3. 1. Use Shlaer Mellor Methodology with arrow heads for 1:1, 1:M, and M:M
  4. 2. Create a class with all SQL data types, e.g. name CHAR, age NUM to update wc2.ini
  5. 3. Enter attribute size and constraints, e.g. (10)NOT_NULL in -ATTRIBUTE_USER1 text box
  6. 4. Check Index Box for all attributes that are a key or index
  7. 5. Enter index keywords, e.g. UNIQUE CLUSTERED in ATTRIBUTE_USER2
  8. 6. Select "Generate - Generate Class Report" and select SQL1.SCT script
  9. for normal SQL or SQLSTORE.SCT for SQL Server code generation with stored procedures.
  10. 7. Please send script improvements to MicroGold 71543.1172@compuserve.com 
  11.    info Richard Felsinger 71162.755@compuserve.com
  12.  
  13.  
  14. SQL Code Generation Script to generate SQL tables for import into Microsoft Access
  15.  
  16. 1. Use Shlaer Mellor Methodology with arrow heads for 1:1, 1:M, and M:M
  17.  
  18. 2. Create a class with all SQL data types, e.g. name TEXT, age LONG to update wc2.ini
  19.  
  20. 3. Enter attribute size e.g. (10)NOT_NULL in ATTRIBUTE_USER1 text box
  21.  
  22. 4. Check Index Box for all attributes that are a key or index
  23.  
  24. 5. Enter index keywords, e.g. UNIQUE or PRIMARY KEY in ATTRIBUTE_USER2.  The keyword
  25. FOREIGN KEY does not compile in Microsoft Access.  
  26.  
  27. 6. Select "Generate - Generate Class Report", enter a file name, e.g SQLRPT.TXT and 
  28. select SQLACCES.SCT script.  This script assumes you will have at least one index,
  29. e.g. PRIMARY KEY.  If you don't have an index, you will have to delete the last
  30. comma.
  31.  
  32. 7. Select "File Edit File" to open SQLRPT.TXT
  33.  
  34. 8. Select and copy all the SQL statements for a single table 
  35.  
  36. 9. In Microsoft Access, select Query New, then SQL or SQL - Data Definition, then paste 
  37. the SQL statements for a single table, then Save.  If necessary correct any syntax errors. 
  38.  
  39. 10. In Microsoft Access, select Query Open to create the table
  40.  
  41. 11. Repeat the cut and paste for all tables.  
  42.  
  43. Problems: 1) Access 2.0 does not let you create multiple tables in one 
  44. query.  2) I have not been able to create a foreign key using SQL.
  45. The following SQL statement may be modified to create a foreign key:
  46. CONSTRAINT customerFK REFERENCES Customer,
  47.  
  48. Please send script improvements to MicroGold 71543.1172@compuserve.com 
  49.    info Richard Felsinger 71162.755@compuserve.com  803-881-3648
  50.  
  51.  
  52.  
  53.